package com.iszhouhua.blog.service.vue.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iszhouhua.blog.mapper.ArticleMapper;
import com.iszhouhua.blog.model.Article;
import com.iszhouhua.blog.model.vo.ArticleVo;
import com.iszhouhua.blog.service.vue.BlogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BlogServiceImpl extends ServiceImpl<ArticleMapper, Article> implements BlogService {
  @Resource
  private ArticleMapper articleMapper;

  @Override
  public IPage<ArticleVo> queryAllBlog(IPage<ArticleVo> page) {
//    IPage<Article> articleIPage = articleMapper.selectPage(page, null);
    IPage<ArticleVo> articleIPage = articleMapper.queryAllBlog(page);
    return articleIPage;
  }

  @Override
  public Article queryBlogById(Integer id) {
    return articleMapper.selectById(id);
  }

}
